<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.csd.helper.IConstant"%>
<%@page import="com.csd.helper.Tool"%>
<%@page import="com.csd.vo.ChangeRecordVO"%>
<%@page import="com.csd.vo.UserVO"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ChangeRecordVO changeRecordVO = (ChangeRecordVO)request.getAttribute("changeRecordVO");
UserVO userVO = (UserVO)session.getAttribute(IConstant.userVO);

if(userVO==null || changeRecordVO == null)
{
	response.sendRedirect(path+"/teacher/right_well.jsp");
}

String returnpage = (String)request.getAttribute("returnpage");

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>变更细节</title>
<link href="<%=path%>/teacher/css/teacher_right.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="<%=path%>/student/js/check.js"></script>
</head>

<body>
    <div class="main">
        <h1>变更申请详细</h1>
        <hr />
        <table align="center" width="100%">
            <tr>
                <td class="form_strong" width="150px" >项目名称：</td>
                <td>        
                	<span class="form_strong"><%=changeRecordVO.getProjectName() %></span>               
                </td>
            </tr>
            <tr>
                <td class="form_strong" valign="middle">申请时间：</td>
                <td><%=Tool.dateToString( changeRecordVO.getApplyDate()) %></td>
            </tr>
            <tr>
                <td class="form_strong" valign="middle">变更理由：</td>
                <td>
                <span style="padding:10px; text-align:left; font-size:11px; margin:10px; color:#666; text-indent:2ems;"><s:property value='changeRecordVO.reason'/></span>
                </td>
            </tr>

            <tr>
                <td class="form_strong" valign="middle">变更内容：</td>
                <td>
                <span style="padding:10px; text-align:left; font-size:11px; margin:10px; color:#666; text-indent:2ems;""><s:property value='changeRecordVO.content'/></span>
                </td>
            </tr>
            <tr>
                <td class="form_strong" valign="middle">变更的状态：</td>
                <td><s:property value='changeRecordVO.state'/></td>
            </tr>
            <%if(!changeRecordVO.getState().equals(IConstant.teacherUnhandle) 
            	&& userVO.getType().equals(IConstant.teacherRole)){%>
            <tr>
                <td class="form_strong" valign="middle">指导老师意见：</td>
                <td><s:property value='changeRecordVO.opinionOfTeacher'/></td>
            </tr>
            <%} 
            else if(userVO.getType().equals(IConstant.teacherRole)) {%>

			
            <tr>
            	<td colspan="2">
            	<form action="<%=path%>/teacherChangeResult.action" method="post" onsubmit="javascript:return checkForm(this);">
                <input type="hidden" name="changeRecordID" value="<%=changeRecordVO.getChangeRecordID()%>" />
            	<table width="100%" cellspacing="5px">
                    <tr>
                    	<td valign="middle" class="form_strong" width="150px">审批工作：</td>
                        <td width="150px">                  
                            <select name="changeResult">
                                <option value="1">同意</option>
                                <option value="0">驳回</option>            
                            </select>
                        </td>
                    </tr>
                    <tr>
                    	<td valign="middle" class="form_strong" width="150px">审批意见：</td>
                        <td>
                    		<textarea rows="5" cols="50" name="advice" onblur="javascript:checkNotNull(this);">这个随你们吧！</textarea>                    
                		</td>
                    </tr>
                    <tr>
                    	<td colspan="2" align="center"><input type="submit" value=" 完成 " /></td>
                    </tr>
                </table>
                </form>
                </td>
            </tr>

            <%} 
            	else if(changeRecordVO.getState().equals(IConstant.managerUnhandle)
            	&& userVO.getType().equals(IConstant.managerRole)){ %>
            <tr>
                <td class="form_strong" width="150px" valign="middle">指导老师意见：</td>
                <td>
                	<span style="padding:10px; text-align:left; font-size:11px; margin:10px; color:#666; text-indent:2ems;"><s:property value='changeRecordVO.opinionOfTeacher'/></span>
                </td>
            </tr>
            <tr>
                <td class="form_strong" valign="middle">受理情况:</td>
                <td>
                	<form action="<%=path%>/changeRecordHandle.action" method="post">
                    <select name="result" id="result">
                        <option id="1" value="1">已经受理</option>
                        <option id="0" value="0">不予受理</option>            
                    </select>
                    &nbsp;
                    <input type="submit" value=" 完成 "/>
                    <input type="hidden" name="changeRecordID" value="<s:property value='changeRecordVO.changeRecordID'></s:property>"/>
                    </form>
                </td>
            </tr>
            <%} %>
            <%if(returnpage != null) {%>
            <tr>      
                <td colspan="2" align="center">
                	<br />
                	<a href="<%=returnpage %>">返回</a>
                </td>
            </tr>
            <%} %>
        </table>
    </div>
</body>
</html>
